﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP.User
{
    public partial class check_username : System.Web.UI.Page
    {
        public int count = 0, check=0;
        protected void Page_Load(object sender, EventArgs e)
        {
            string username = Request.QueryString["username"];
            var check_username = new TblUserController().FetchAll().Where(x => x.UserName.ToLower().Trim() == username.ToLower().Trim()).ToList();
            count = check_username.Count;
            if(checkSpecialChar(username.Trim()) == true)
            {
                check=1;
            }
        }
        static bool checkSpecialChar(string s)
        {
            if (s.Contains("`~!@#$%^&*()_-+=\\|}][{:;\"'/?.>,<"))
                return true;

            return false;
        }
    }
}